package com.codingvip.link;

public class ListNode {
    int val;
    ListNode next = null;

    ListNode(int val) {
        this.val = val;
    }

    public static void printList(ListNode nodeList) {
        System.out.print("Node:=" + nodeList.val + "");
        while (nodeList != null) {
            ListNode next = nodeList.next;
            System.out.print("-->" + (next == null ? "NULL" : next.val));
            nodeList = next;
        }
        System.out.println("");

    }


}
